<?php
/*
通知表查询方法

*/

namespace Home\Model;
use Think\Model;
class NewsModel extends Model{

//查询bank
  public function selectNews($where,$order){
    $News = $this->where($where)->order('news_id desc')->select();
    if($News){
      return $News;
    }
    else{
      return false;
    }
  }

//添加News
  public function addNews($data){
    $res = $this->add($data);
    if($res){
      return $res;
    }
    else{
      return false;
    }
  }

  //根据id查询
  public function findData($id){
    $res = $this->where(array('news_id'=>$id))->find();
    if($res){
      return $res;
    }
    else{
      return '1,2';
    }
  }



//保存修改
  public function saveNews($id,$data){
    $News = $this->where(array('news_id'=>$id))->save($data);
    if($News){
      return ture;
    }
    else{
      return false;
    }
  }

  //查询数据条数
  public function countNews($where){
    $num  = $this->where($where)->count();
    return $num;
  }














}
